﻿using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebMediaTRApi.Services;
using WebMediaTRApi.WeatherForcasts.Querys;

namespace WebMediaTRApi.WeatherForcasts.Handlers
{
 
    public class CreateWeatherCommandHandler : RequestHandler<CreateWeatherCommand, WeatherForecast>
    {
        private readonly WeatherForecastService _service;

        public CreateWeatherCommandHandler(WeatherForecastService service)
        {
            _service = service;
        }

        protected override WeatherForecast Handle(CreateWeatherCommand request)
        {
            return _service.CreateWeather(request);
        }

    }
}
